<?php
require("Loginout.php");

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录</title>
<style type="text/css">
 *{
	margin-left:auto;
	margin-right:auto;

	

 }
            input[type = "text"], input[type = "password"] {
                width: 150px;
            }
			table{
			background-color:}
        </style>

</head>

<body style="background:url(img/background.jpg);" >
<div style="margin-top:200px;">
 
  <div >
			
       
    <center>
	<br>
	<br>
	<br>
      <form name="myform" action="logincheck.php" method="post" onsubmit="login()" >
          
		  	<table width="30%" height="50%" border="0" cellspacing="0"  >
<tr>        
        <th colspan="2"></th>	
  		      </tr>	  		
		  		   <tr>
		  		   	  <td height="36" align="right">账号：</td>
      <td >
		  <input type="text" name="username" id="username" onBlur="check()" />
                     <span id="usernames"></span>*  </td>
  		      </tr>
		  		   <tr>
		  		      <td height="38" align="right">密码：</td>	
	  		         <td>
  		             <input type="password" name="password" id="password" onBlur="check()"/>
                     <span id="psws"></span>				   					 * </td>
  		      </tr>
               

				     
		  		   
		  		   	   <td colspan="2" align="center"> 
		  		   	   	 
                           <input type="submit" name="Submit" value="登录"  />
                            &nbsp;&nbsp;&nbsp;&nbsp;
		  		   	   	   
		  		   	   	   </td>	
  		   	  </tr>
		  	</table>
          
  </form>
  </center>
  <script type="text/javascript">
   function	 username(){
			
		     	   var username = document.getElementById("username").value;  //用户名
				 //用户名的判断
				// var r = /^[A-Za-z]+$/;
                  
                   if(username == ""){	     	    			     	    	
		     	  	    document.getElementById("usernames").innerHTML = "<font color='red'>用户名不可以为空</font>";
		     	  	    return false;
		     	    }  
					 
					else if(username !="")
					{
				      	 if(username.length<3)
						  {
						   document.getElementById("usernames").innerHTML = "<font color='red'>用户名至少3位</font>";
							return false;
						  }
						 else{
								    document.getElementById("usernames").innerHTML = "<font color='green'></font>";
										return true;
							 }
		     	    
		     	        }
					}

  function password()
					{
							var psw = document.getElementById("password").value;  
						   //密码				//密码的判断
						 if(psw=="")
						 {
				
								 document.getElementById("psws").innerHTML = "<font color='red'>密码不可以为空</font>";
								  return false;
						}
						else if(psw !="")
						{
							  if(psw.length<6)
							  {
							   document.getElementById("psws").innerHTML = "<font color='red'>密码至少六位</font>";
							   return false;
							  }
							  else{
								  document.getElementById("psws").innerHTML = "<font color='green'></font>";
									return true;
							  }
						
						}
				}
				 function check(){
                if (username()&&password()) {
                    return true;
                }
                else {
                    return false;
                }
            }
			
		  </script>
  </div></div>

   
  
</body>
</html>
